{extend name='admin@public/content'}

{block name="content"}
<form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" id="ProductForm" class='form-horizontal layui-form padding-top-20'>

    <!--{if !empty($cates)}-->
    <!--<div class="form-group">
        <label class="col-sm-2 control-label">项目分类</label>
        <div class='col-sm-8 text-top'>
            <select required class="layui-select full-width" name="cate_id">
                {foreach $cates as $cate}
                &lt;!&ndash;{if isset($vo.cate_id) and $cate.cate_id eq $vo.cate_id}&ndash;&gt;
                <option selected value="{$cate.cate_id}">{$cate.name}</option>
                &lt;!&ndash;{else}&ndash;&gt;
                <option value="{$cate.cate_id}">{$cate.name}</option>
                &lt;!&ndash;{/if}&ndash;&gt;
                {/foreach}
            </select>
        </div>
    </div>-->
    <!--{/if}-->


    <div class="form-group">
        <label class="col-sm-2 control-label">姓名</label>
        <div class='col-sm-8'>
            <input name="sub_item" required value="{$vo.sub_item|default=''}" class="layui-input" title="请输入姓名" placeholder="请输入姓名">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">公司</label>
        <div class='col-sm-8'>
            <input name="sub_item2"  value="{$vo.sub_item2|default=''}" class="layui-input" title="请输入公司" placeholder="请输入公司">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">电话</label>
        <div class='col-sm-8'>
            <input name="phone"  value="{$vo.phone|default=''}" class="layui-input" title="请输入电话" placeholder="请输入电话">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">拍摄器材</label>
        <div class='col-sm-8'>
            <input name="type"  value="{$vo.type|default=''}" class="layui-input" title="请输入拍摄器材" placeholder="请输入拍摄器材">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">拍摄时间</label>
        <div class='col-sm-8'>
            <input name="time"  value="{$vo.time|default=''}" class="layui-input" title="请输入拍摄时间" placeholder="请输入拍摄时间">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">地址</label>
        <div class='col-sm-8'>
            <input name="address"  value="{$vo.address|default=''}" class="layui-input" title="请输入地址" placeholder="请输入地址">
        </div>
    </div>

    <input type="hidden" name="small_pic" value="{$vo.small_pic|default=''}">

    <!--<div class="form-group">
        <label class="col-sm-2 control-label label-required">缩略图</label>
        <div class='col-sm-8'>
            <table class="layui-table background-item margin-none" lay-size="sm" lay-skin="nob">
                <thead>
                <tr>
                    <td>缩略图</td>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td class="text-top" style="width:100px">
                        <input type="hidden" name="small_pic" value="{$vo.small_pic|default=''}">
                    </td>

                </tr>
                </tbody>
            </table>
        </div>
    </div>-->

    <div class="form-group">
        <label class="col-sm-2 control-label label-required">缩略图</label>
        <div class='col-sm-8'>
            <table class="layui-table background-item margin-none" lay-size="sm" lay-skin="nob">
                <thead>
                <tr>
                    <td>缩略图{if !empty($vo.startpicurl)}(<a target="_blank" href="{$vo.startpicurl|default=''}">预览</a>){/if}</td>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td class="text-top" style="width:100px">
                        <input type="hidden" name="startpicurl" value="{$vo.startpicurl|default=''}">
                    </td>

                </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">A组名称</label>
        <div class='col-sm-8'>
            <input name="item" required value="{$vo.item|default=''}" class="layui-input" title="请输入A组名称" placeholder="请输入A组名称">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label label-required">A组图片</label>
        <div class='col-sm-8'>
            <table class="layui-table background-item margin-none" lay-size="sm" lay-skin="nob">
                <thead>
                <tr>
                    <td>A组图片(可批量选择)</td>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td class="text-top" style="width:100px">
                        <input type="hidden" name="startpicurl2" value="{$vo.startpicurl2|default=''}">
                    </td>

                </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">B组名称</label>
        <div class='col-sm-8'>
            <input name="ewmimage" value="{$vo.ewmimage|default=''}" class="layui-input" title="请输入B组名称" placeholder="请输入B组名称">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">B组图片</label>
        <div class='col-sm-8'>
            <table class="layui-table background-item margin-none" lay-size="sm" lay-skin="nob">
                <thead>
                <tr>
                    <td>B组图片(可批量选择)</td>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td class="text-top" style="width:100px">
                        <input type="hidden" name="startpicurl3" value="{$vo.startpicurl3|default=''}">
                    </td>

                </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">项目详情</label>
        <div class='col-sm-8'>
            <textarea class="layui-textarea" name="intro" placeholder="请输入项目详情">{$vo.intro|default=''}</textarea>
        </div>
    </div>


    <div class="hr-line-dashed"></div>

    <div class="col-sm-7 col-sm-offset-2">
        <div class="layui-form-item text-center">
            {if !empty($vo.id)}<input type="hidden" name="id" value="{$vo.id}">{/if}
            <button class="layui-btn" type="submit">提交</button>
            <button class="layui-btn layui-btn-danger" type='button' onclick="window.history.back()">取消</button>
        </div>
    </div>

</form>

<script>
    require(['jquery', 'ckeditor', 'angular'], function () {
        window.form.render();
        window.createEditor('[name="intro"]', {height: 500});
        var app = angular.module("ProductForm", []).run(callback);
        angular.bootstrap(document.getElementById(app.name), [app.name]);

        function callback() {
            // 单图片上传处理
//            $('#ProductForm [name="small_pic"]').uploadOneImage();
            $('#ProductForm [name="startpicurl"]').uploadOneImage();
            $('#ProductForm [name="startpicurl2"]').uploadMultipleImage();
            $('#ProductForm [name="startpicurl3"]').uploadMultipleImage();

        }
    });
</script>
{/block}

{block name="style"}
<style>

    .background-item {
        padding: 15px;
        background: #efefef;
    }

    .background-item thead tr {
        background: #e0e0e0
    }

    .price-input-td {
        padding: 0 !important;
    }

    .price-input-td:before {
        margin: 4px;
        width: 35px;
        height: 22px;
        content: "金额";
        line-height: 20px;
        text-align: center;
        position: absolute;
        background: #e2e2e2;
    }

    .price-input-td input {
        height: 30px;
        padding-left: 50px;
        border: none !important;
    }
</style>
{/block}